<?php

namespace App\Models;


use Illuminate\Database\Eloquent\Model;

class Seting extends Model
{

    protected $table = 'setting';
    public $timestamps = false;

    static function getSetting(){
        return self::all()->pluck('value','key');
    }

    /*查询某个配置信息*/
    public static function get($name,$default='')
    {
        $setting =  self::where('key','=',$name)->first();
        if($setting){
            return $setting->value;
        }
        return $default;
    }
}
